#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTextBrowser>
#include <QTime>
#include <QFile>
#include <QString>
#include <QPen>
#include <QMouseEvent>
#include <QDir>
#include <QFileInfoList>
#include <QListWidgetItem>
#include <QtCore>

#include "drawwave.h"

#include "ddscom.h"


namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

signals:
    void ddsUpdate();
    
public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
    QString UDiskPath;
    //ddsComParameter ddspara;
    
private slots:
    void dds_paraUpdate();

    void on_pushButtonConnect_clicked();

    void on_dial_setFrequence_actionTriggered(int action);

    void on_dial_setVpp_actionTriggered(int action);

    void on_dial_setOffset_actionTriggered(int action);

    void on_doubleSpinBox_setFrequence_valueChanged(double arg1);

    void on_doubleSpinBox_setVpp_valueChanged(double arg1);

    void on_doubleSpinBox_setOffset_valueChanged(double arg1);

    //void on_comboBox_waveSel_activated(const QString &arg1);

    void on_comboBox_waveSel_activated(int index);

    void on_textBrowser_infoOut_textChanged();


    void on_pushButton_drawWave_clicked();

    void on_pushButton_refresh_clicked();

    void on_listWidget_itemClicked(QListWidgetItem *item);

    //void on_waveListRefresh();

    void on_ddsParaUpdate();

    //void on_listWidget_currentRowChanged(int currentRow);

private:
    Ui::Widget *ui;
    DDSCOM *ddscom;

//    QMouseEvent mouseEvent;
    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent * event);
//    void mouseReleaseEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
//    void paint(QPixmap &thePixmap);

    void waveListRefresh(const QString &path);
    void ctlParaAutoUpdate(const QString &UDiskPath , char *paraData);

    QTimer *dds_paraTimer;
    drawWave *drawWaveWindow;

};

#endif // WIDGET_H
